//
//  HJWithdrawVC.m
//  project
//
//  Created by yefei on 2019/7/31.
//  Copyright © 2019 健健. All rights reserved.
//

#import "HJWithdrawVC.h"
#import "HJWithdrawCell.h"

@interface HJWithdrawVC ()

@end

@implementation HJWithdrawVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navTitle = @"提现明细";
    [self loadNetworkData];
}

-(void)configTableView {
    self.needRefresh = YES;
    [super configTableView];
    self.tableView.estimatedRowHeight = 70;
}

-(void)loadNetworkData {
    NSString * url = [Api stringByAppendingString:@""];
    [HJHttpTool get:url params:nil success:^(HJResponeds *result) {
        if (self.page ==1) {
            [self.models removeAllObjects];
        }
        NSArray * arr =[NSArray yy_modelArrayWithClass:[HJWithdrawModel class] json:result.data];
        [self.models addObjectsFromArray:arr];
        [self.tableView reloadData];
        [self.tableView endRefresh];
    } failure:^(id result) {
        [self.tableView endRefresh];
        [YFHud showError:result];
    }];
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.models.count;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString * cellIdentifier = @"withdrawCell";
    
    HJWithdrawCell * cell = [tableView cellForRowAtIndexPath:indexPath];
    if (!cell) {
        cell = [[HJWithdrawCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
    }
    
    return cell;
}

@end


@implementation HJWithdrawModel

- (NSString *)description {
    return [self yy_modelDescription];
}
@end
